
** Code for calculating the switching cost dollar equivalent

global data ../china/data

* Dollar Cost Calculations

use $data/all0506_hs10, clear
keep if hs=="8525209070"
keep if year==2006

bysort firmid: egen imp_q=total(q)
bysort firmid: egen imp_v=total(v)

gen rel_share=v/imp_v
gsort firmid -rel_share
by firmid: gen obs=_n
drop if obs!=1

summ log_price, d
gen zeta= switch_cost/((BW-1)*alpha)
summ p, d
disp `r(p50)'*exp(zeta)
* median price would rise from $$ to $$*$$=$$$
